package cn.kpi.service.sys.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kpi.dao.sys.UserGroupDao;
import cn.kpi.entity.sys.OrgEntity;
import cn.kpi.entity.sys.UserEntity;
import cn.kpi.service.sys.IUserGroupService;

@Service
public class UserGroupServiceImpl  implements IUserGroupService {
	@Autowired
	private UserGroupDao userGroupDao;

	public List<UserEntity> GetUserListByWhere(String where)throws Exception{
		try{
			return userGroupDao.GetUserListByWhere(where);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return null;
		}
	}
	public List<OrgEntity> GetOrgListByWhere(String where)throws Exception{
		try{
			return userGroupDao.GetOrgListByWhere(where);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return null;
		}
	}
	public int UpdateUserGroup(Long groupid,String where)throws Exception{
		try{
			return userGroupDao.UpdateUserGroup(groupid,where);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}
	public int UpdateUserGroupNull(Long userid)throws Exception{
		try{
			return userGroupDao.UpdateUserGroupNull(userid);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}
}
